<?php
/**
 * Shortcut of the MPackage::import function
 * @param String $package : Package to import
 */
function __import($package){
    MPackage::import($package);
}

/**
 * Shortcut of the MRequest::redirect function
 * @param String $url : URL to redirect
 */
function __redirect($url) {
    MRequest::redirect($url);
}

/**
 * Shortcut of the MPublisher::publish function
 * @param String $path : The absolute path of the file (or directory) to publish
 * @return String||Boolean : The relative path to the copied file. Boolean if it was a directory
 */
function __publish($path){
    return MPublisher::publish($path);
}

function __route($route, $params=array()){
    return MRouter::getInstance()->createRoute($route, $params);
}

/**
 * Shortcut of the MTemplate::getInstance function
 * @return MTemplate : Current template instance
 */
function __template(){
    return MTemplate::getInstance();
}

/**
 * Shortcut of the MTranslator::translate function
 * @param String $message : The message to translate
 * @param Array $params (optional) : Parameters of the message
 * @param String $source (optional) : The name of the concerned part of the application (example : a module name). 
 * @param String $category (optional) : The category of the source (example : if it's a module : 'modules')
 * @param String $language (optional) : The language to translate to
 * @return String : The translated message 
 */
function __t($message,$params=NULL,$source=NULL,$category=NULL,$language=NULL){
    return MTranslator::translate($message, $params, $source, $category, $language);
}

/**
 * Shortcut of the MHtml::tag function
 * @param String $tag : Tag name (a, p, div...)
 * @param Array $htmlOptions (optional) : HTML options to add to the tag (class, id...)
 * @param String $content (optional) : Content between start and end of tag. Default set to false for no content.
 * @return String : XHTML Code of the tag
 */
function __tag($tag, $htmlOptions=array(), $content=false){
    return MHtml::tag($tag, $htmlOptions, $content);
}

function __adminMenu($module){
    return MMenu::renderAdminMenu($module);
}
?>
